package com.webside.points.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.webside.points.mapper.UserPostMapper;
import com.webside.points.model.UserPostEntity;
import com.webside.points.service.UserPostService;
import com.webside.points.wechat.BeanFactory;

@Service("userPostService")
public class UserPostServiceImpl implements UserPostService{

	@Autowired
	UserPostMapper userPostMapper;
	
	public static UserPostService getInstance(){
		return (UserPostService) BeanFactory.getBean("userPostService");
	}

	@Override
	public UserPostEntity findByUserId(UserPostEntity userPostEntity) {
		return userPostMapper.findByUserId(userPostEntity);
	}

	@Override
	public int insert(UserPostEntity userPostEntity) {
		return userPostMapper.insert(userPostEntity);
	}

	@Override
	public UserPostEntity findByTransactionId(String transactionId) {
		return userPostMapper.findByTransactionId(transactionId);
	}

	@Override
	public int update(UserPostEntity userPostEntity) {
		return userPostMapper.update(userPostEntity);
	}
}
